<?php

/**
 * Alumno form base class.
 *
 * @method Alumno getObject() Returns the current form's model object
 *
 * @package    reducars
 * @subpackage form
 * @author     victor
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseAlumnoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_alumno'        => new sfWidgetFormInputHidden(),
      'id_clase'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Clase'), 'add_empty' => false)),
      'id_comuna'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Comuna'), 'add_empty' => false)),
      'alum_nombre'      => new sfWidgetFormInputText(),
      'alum_apellidos'   => new sfWidgetFormInputText(),
      'alum_rut'         => new sfWidgetFormInputText(),
      'alum_correo'      => new sfWidgetFormInputText(),
      'alum_direccion'   => new sfWidgetFormInputText(),
      'alum_fono_fijo'   => new sfWidgetFormInputText(),
      'alum_fono_movil'  => new sfWidgetFormInputText(),
      'alum_user'        => new sfWidgetFormInputText(),
      'alum_pass'        => new sfWidgetFormInputText(),
      'alum_aprueba_teo' => new sfWidgetFormInputText(),
      'alum_fech_ingre'  => new sfWidgetFormDate(),
      'alum_ulti_ingre'  => new sfWidgetFormDate(),
      'alum_habilitado'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id_alumno'        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_alumno')), 'empty_value' => $this->getObject()->get('id_alumno'), 'required' => false)),
      'id_clase'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Clase'))),
      'id_comuna'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Comuna'))),
      'alum_nombre'      => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'alum_apellidos'   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'alum_rut'         => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'alum_correo'      => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'alum_direccion'   => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'alum_fono_fijo'   => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'alum_fono_movil'  => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'alum_user'        => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'alum_pass'        => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'alum_aprueba_teo' => new sfValidatorInteger(array('required' => false)),
      'alum_fech_ingre'  => new sfValidatorDate(array('required' => false)),
      'alum_ulti_ingre'  => new sfValidatorDate(array('required' => false)),
      'alum_habilitado'  => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('alumno[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Alumno';
  }

}
